package ckw.database.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import core.database.EntityAction;

public class ElectionNodeChange implements Serializable {
	private static final long serialVersionUID = 536588076360256810L;
	private String locatorURI;
	private EntityAction action = null; // TO CHYBA NIE POTRZEBNE
	private List<AdministratorTokenChange> tokens = new ArrayList<AdministratorTokenChange>();
	private List<VoterChanges> voters = new ArrayList<VoterChanges>();
	
	public ElectionNodeChange(String locatorURI) {
		this.locatorURI = locatorURI;
	}
	
	public ElectionNodeChange(String locatorURI, EntityAction action) {
		this.locatorURI = locatorURI;
		this.action = action;
	}

	public String getLocatorURI() {
		return locatorURI;
	}

	public EntityAction getAction() {
		return action;
	}

	public void setAction(EntityAction action) {
		this.action = action;
	}

	public List<AdministratorTokenChange> getTokens() {
		return tokens;
	}

	public List<VoterChanges> getVoters() {
		return voters;
	}

	public void addToken(AdministratorTokenExtended token, EntityAction action) {
		tokens.add(new AdministratorTokenChange(token, action));
	}

	public void addVoter(Voter voter, EntityAction action) {
		voters.add(new VoterChanges(voter, action));
	}
}
